package com.shihb.akka.actors

import java.util.concurrent.TimeUnit

import akka.actor.Actor

/**
 * Description:
 *
 * @author shihb
 * @date 2020/10/2 20:28
 */
class BActor extends Actor {
  override def receive: Receive = {
    case "开打"=>{
      println("BActor(乔峰) 挺猛 看我降龙十八掌")
      // 通过sender() 可以发送消息actor的ref
      TimeUnit.SECONDS.sleep(2)
      sender ! "我打"
    }
  }
}
